#include <bits/stdc++.h>

using namespace std;
using ll = long long;
const int MAXN = 1e6 + 10;
const int MOD = 998244353;

ll dp[MAXN][11];
int main() {
#ifdef LOCAL
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);
#endif
    int n;
    cin >> n;

    for (int i = 1; i <= 9; i++) {
        dp[1][i] = 1;
    }

    for (int i = 2; i <= n; i++) {
        for (int j = 1; j <= 9; j++) {
            dp[i][j] = (dp[i-1][j-1] + dp[i-1][j] + dp[i-1][j+1]) % MOD;
        }
    }

    ll ans = 0;
    for (int i = 1; i <= 9; i++) {
        ans = (ans + dp[n][i]) % MOD;
    }
    cout << ans << endl;

    return 0;
}